import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const router = new VueRouter({
  mode: "hash",
  routes: [
    {
      path: '/',
      redirect: '/index'
    },
    {
      path: '/index',
      name: 'index',
      component: () => import('../views/index.vue')
    },
    {
      path: '/course',
      name: 'course',
      component: () => import('../views/course.vue')
    },
    {
      path: '/practice',
      name: 'practice',
      component: () => import('../views/practice.vue')
    }, {
      path: '/record',
      name: "record",
      component: () => import('../views/record.vue')
    }, {
      path: '/user',
      name: 'user',
      component: () => import('../views/user.vue'),
    },
    {
      path: '/concern',
      name: 'concern',
      component: () => import('../views/concern.vue'),
        
    
    },
    {
      path: '/coursedet',
      name: 'coursedet',
      component: () => import('../views/coursedet.vue')
    },
    {
      path: '/custmoer',
      name: 'custmoer',
      component: () => import('../views/custmoer.vue')
    },
    {
      path: '/smslogin',
      name: 'smslogin',
      component: () => import('../views/smslogin.vue')
    },
    {
      path: '/options',
      name: 'options',
      component: () => import('../views/options.vue')
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/login.vue')
    },
    {
      path: '/setpassword',
      name: 'setpassword',
      component: () => import('../views/setpassword.vue')
    },
    {
      path: '/info',
      name: 'info',
      component: () => import('../components/mine/info.vue')
    },
    {
      path: '/teacherDetail',
      name: 'teacherDetail',
      component: () => import('../views/teacherDetail.vue')
    },
  ]
})


const originalPush = VueRouter.prototype.push
// 重写push函数
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

export default router
